<?php

namespace app\index\model;

use think\Model;


class PcSoftInfo extends Model
{
    //状态，0:无效,1:有效
    const STATUS_0 = 0;
    const STATUS_1 = 1;

    //推荐，0:不推荐,1:推荐
    const RECOMMEND_0 = 0;
    const RECOMMEND_1 = 1;

    //拉起类型，0:不拉起，1：拉起
    const SUCCESS_TYPE_0 = 0;
    const SUCCESS_TYPE_1 = 1;

    // 表名
    protected $name = 'pc_soft_info';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];

    public function categorysoft()
    {
        return $this->belongsTo('CategorySoft', 'CateId', 'Id', [], 'LEFT')->setEagerlyType(0);
    }

    /**
     * 返回所有状态名称
     * @return string[]
     */
    public function getStatus(){
        return [
          self::STATUS_0 => '无效',
          self::STATUS_1 => '有效',
        ];
    }
    /**
     * 返回所有推荐名称
     * @return string[]
     */
    public function getRecommend(){
        return [
            self::RECOMMEND_0 => '不推荐',
            self::RECOMMEND_1 => '推荐',
        ];
    }
    /**
     * 返回所有拉起名称
     * @return string[]
     */
    public function getSuccessType(){
        return [
            self::SUCCESS_TYPE_0 => '不拉起',
            self::SUCCESS_TYPE_1 => '拉起',
        ];
    }
}
